package jh.slm.calculations;

public class Resampling16_75{

	public Object Input;
	public Object Output;
	Object state;
	int[] coef;
	int length;

	public Resampling16_75(int length){
		this.length = length;
		int up = 16;
		int down = 75;
		Output = Allocator.Allocate(length * up / down);
		coef = Coef();
		state = Resampling.Init(down, up, coef);
	}
	
	public void Free(){
		Allocator.Free(Output);
	}
	
	public void Connect(Object input) {
		Input = input;
	}

	public void Compute() {
		Resampling.Resample(length, Input, Output, state);
	}
	
	public int[] GetOutput()
	{
		return Allocator.DeRefInt(Output);
	}
	
	private int[] Coef(){
		return new int[]{
				-28169,
				-4353,
				-4679,
				-5015,
				-5360,
				-5713,
				-6075,
				-6446,
				-6825,
				-7213,
				-7608,
				-8011,
				-8421,
				-8837,
				-9257,
				-9680,
				-10103,
				-10526,
				-10948,
				-11368,
				-11786,
				-12204,
				-12621,
				-13037,
				-13451,
				-13854,
				-14243,
				-14613,
				-14976,
				-15343,
				-15729,
				-16012,
				-16346,
				-16641,
				-16916,
				-17173,
				-17406,
				-17616,
				-17800,
				-17958,
				-18085,
				-18183,
				-18248,
				-18280,
				-18277,
				-18238,
				-18161,
				-18045,
				-17888,
				-17688,
				-17443,
				-17152,
				-16814,
				-16430,
				-15998,
				-15516,
				-14978,
				-14385,
				-13738,
				-13043,
				-12293,
				-11468,
				-10606,
				-9675,
				-8686,
				-7639,
				-6529,
				-5361,
				-4130,
				-2840,
				-1488,
				-76,
				1398,
				2932,
				4526,
				6180,
				7893,
				9663,
				11490,
				13372,
				15311,
				17303,
				19349,
				21443,
				23585,
				25774,
				28010,
				30290,
				32608,
				34962,
				37354,
				39783,
				42233,
				44717,
				47222,
				49748,
				52291,
				54848,
				57416,
				59989,
				62565,
				65138,
				67707,
				70265,
				72810,
				75335,
				77839,
				80314,
				82757,
				85162,
				87527,
				89844,
				92112,
				94321,
				96470,
				98552,
				100564,
				102500,
				104354,
				106120,
				107798,
				109381,
				110858,
				112234,
				113498,
				114646,
				115675,
				116578,
				117353,
				117995,
				118500,
				118862,
				119079,
				119145,
				119059,
				118816,
				118414,
				117848,
				117116,
				116214,
				115142,
				113897,
				112476,
				110876,
				109098,
				107140,
				105002,
				102681,
				100177,
				97490,
				94623,
				91572,
				88340,
				84930,
				81340,
				77574,
				73634,
				69520,
				65238,
				60788,
				56177,
				51406,
				46481,
				41404,
				36183,
				30821,
				25324,
				19698,
				13949,
				8083,
				2109,
				-3968,
				-10139,
				-16399,
				-22736,
				-29144,
				-35613,
				-42136,
				-48702,
				-55302,
				-61925,
				-68563,
				-75206,
				-81840,
				-88459,
				-95049,
				-101600,
				-108102,
				-114541,
				-120909,
				-127191,
				-133378,
				-139457,
				-145418,
				-151247,
				-156935,
				-162467,
				-167834,
				-173023,
				-178023,
				-182822,
				-187410,
				-191774,
				-195904,
				-199790,
				-203419,
				-206782,
				-209870,
				-212671,
				-215177,
				-217376,
				-219264,
				-220827,
				-222060,
				-222954,
				-223502,
				-223697,
				-223533,
				-223002,
				-222101,
				-220823,
				-219166,
				-217123,
				-214693,
				-211872,
				-208658,
				-205049,
				-201046,
				-196647,
				-191854,
				-186665,
				-181084,
				-175113,
				-168756,
				-162014,
				-154895,
				-147401,
				-139541,
				-131319,
				-122743,
				-113821,
				-104564,
				-94978,
				-85075,
				-74866,
				-64362,
				-53575,
				-42520,
				-31207,
				-19654,
				-7873,
				4118,
				16306,
				28670,
				41197,
				53866,
				66661,
				79561,
				92547,
				105600,
				118699,
				131823,
				144952,
				158064,
				171136,
				184148,
				197076,
				209897,
				222591,
				235132,
				247499,
				259667,
				271615,
				283318,
				294753,
				305898,
				316729,
				327224,
				337360,
				347113,
				356464,
				365389,
				373867,
				381877,
				389398,
				396410,
				402895,
				408831,
				414202,
				418988,
				423175,
				426743,
				429680,
				431968,
				433595,
				434547,
				434812,
				434379,
				433238,
				431379,
				428795,
				425477,
				421422,
				416621,
				411074,
				404778,
				397729,
				389930,
				381380,
				372082,
				362042,
				351261,
				339748,
				327509,
				314555,
				300894,
				286539,
				271502,
				255799,
				239443,
				222453,
				204845,
				186640,
				167859,
				148523,
				128656,
				108282,
				87426,
				66117,
				44381,
				22249,
				-251,
				-23086,
				-46224,
				-69632,
				-93275,
				-117119,
				-141127,
				-165262,
				-189488,
				-213764,
				-238054,
				-262316,
				-286512,
				-310598,
				-334537,
				-358285,
				-381802,
				-405045,
				-427972,
				-450540,
				-472709,
				-494434,
				-515675,
				-536389,
				-556535,
				-576072,
				-594958,
				-613152,
				-630616,
				-647309,
				-663193,
				-678230,
				-692383,
				-705616,
				-717893,
				-729181,
				-739447,
				-748658,
				-756784,
				-763796,
				-769667,
				-774369,
				-777879,
				-780171,
				-781227,
				-781024,
				-779546,
				-776775,
				-772699,
				-767303,
				-760579,
				-752516,
				-743109,
				-732353,
				-720247,
				-706790,
				-691985,
				-675835,
				-658348,
				-639533,
				-619401,
				-597965,
				-575242,
				-551248,
				-526007,
				-499539,
				-471871,
				-443029,
				-413045,
				-381948,
				-349776,
				-316562,
				-282348,
				-247173,
				-211082,
				-174118,
				-136331,
				-97768,
				-58483,
				-18526,
				22044,
				63174,
				104802,
				146869,
				189313,
				232072,
				275078,
				318267,
				361571,
				404921,
				448248,
				491481,
				534547,
				577377,
				619894,
				662027,
				703701,
				744842,
				785374,
				825224,
				864317,
				902578,
				939931,
				976305,
				1011623,
				1045816,
				1078808,
				1110530,
				1140910,
				1169880,
				1197371,
				1223317,
				1247652,
				1270313,
				1291237,
				1310365,
				1327638,
				1343001,
				1356398,
				1367781,
				1377097,
				1384302,
				1389350,
				1392202,
				1392818,
				1391164,
				1387205,
				1380915,
				1372266,
				1361236,
				1347806,
				1331960,
				1313684,
				1292973,
				1269818,
				1244222,
				1216184,
				1185713,
				1152818,
				1117514,
				1079819,
				1039755,
				997349,
				952632,
				905636,
				856403,
				804972,
				751393,
				695713,
				637991,
				578282,
				516652,
				453165,
				387893,
				320909,
				252294,
				182128,
				110497,
				37490,
				-36799,
				-112275,
				-188837,
				-266384,
				-344808,
				-424001,
				-503850,
				-584242,
				-665056,
				-746176,
				-827476,
				-908833,
				-990118,
				-1071205,
				-1151960,
				-1232252,
				-1311946,
				-1390907,
				-1468998,
				-1546081,
				-1622017,
				-1696667,
				-1769891,
				-1841549,
				-1911500,
				-1979604,
				-2045720,
				-2109710,
				-2171433,
				-2230753,
				-2287530,
				-2341630,
				-2392916,
				-2441257,
				-2486520,
				-2528577,
				-2567300,
				-2602564,
				-2634245,
				-2662227,
				-2686389,
				-2706621,
				-2722810,
				-2734850,
				-2742637,
				-2746072,
				-2745059,
				-2739507,
				-2729328,
				-2714441,
				-2694765,
				-2670230,
				-2640763,
				-2606305,
				-2566795,
				-2522180,
				-2472413,
				-2417452,
				-2357259,
				-2291805,
				-2221063,
				-2145015,
				-2063646,
				-1976952,
				-1884928,
				-1787582,
				-1684924,
				-1576972,
				-1463748,
				-1345284,
				-1221616,
				-1092787,
				-958844,
				-819845,
				-675849,
				-526927,
				-373150,
				-214601,
				-51365,
				116464,
				288790,
				465504,
				646500,
				831658,
				1020859,
				1213973,
				1410868,
				1611405,
				1815441,
				2022826,
				2233408,
				2447026,
				2663520,
				2882719,
				3104453,
				3328545,
				3554817,
				3783081,
				4013154,
				4244842,
				4477953,
				4712289,
				4947651,
				5183836,
				5420641,
				5657858,
				5895280,
				6132695,
				6369894,
				6606663,
				6842789,
				7078058,
				7312256,
				7545168,
				7776580,
				8006277,
				8234047,
				8459676,
				8682954,
				8903669,
				9121613,
				9336580,
				9548365,
				9756764,
				9961581,
				10162615,
				10359675,
				10552568,
				10741109,
				10925113,
				11104403,
				11278800,
				11448137,
				11612244,
				11770963,
				11924135,
				12071611,
				12213242,
				12348890,
				12478419,
				12601702,
				12718613,
				12829039,
				12932867,
				13029995,
				13120325,
				13203766,
				13280235,
				13349656,
				13411957,
				13467078,
				13514961,
				13555561,
				13588834,
				13614748,
				13633276,
				13644401,
				13648110,
				13644401,
				13633276,
				13614748,
				13588834,
				13555561,
				13514961,
				13467078,
				13411957,
				13349656,
				13280235,
				13203766,
				13120325,
				13029995,
				12932867,
				12829039,
				12718613,
				12601702,
				12478419,
				12348890,
				12213242,
				12071611,
				11924135,
				11770963,
				11612244,
				11448137,
				11278800,
				11104403,
				10925113,
				10741109,
				10552568,
				10359675,
				10162615,
				9961581,
				9756764,
				9548365,
				9336580,
				9121613,
				8903669,
				8682954,
				8459676,
				8234047,
				8006277,
				7776580,
				7545168,
				7312256,
				7078058,
				6842789,
				6606663,
				6369894,
				6132695,
				5895280,
				5657858,
				5420641,
				5183836,
				4947651,
				4712289,
				4477953,
				4244842,
				4013154,
				3783081,
				3554817,
				3328545,
				3104453,
				2882719,
				2663520,
				2447026,
				2233408,
				2022826,
				1815441,
				1611405,
				1410868,
				1213973,
				1020859,
				831658,
				646500,
				465504,
				288790,
				116464,
				-51365,
				-214601,
				-373150,
				-526927,
				-675849,
				-819845,
				-958844,
				-1092787,
				-1221616,
				-1345284,
				-1463748,
				-1576972,
				-1684924,
				-1787582,
				-1884928,
				-1976952,
				-2063646,
				-2145015,
				-2221063,
				-2291805,
				-2357259,
				-2417452,
				-2472413,
				-2522180,
				-2566795,
				-2606305,
				-2640763,
				-2670230,
				-2694765,
				-2714441,
				-2729328,
				-2739507,
				-2745059,
				-2746072,
				-2742637,
				-2734850,
				-2722810,
				-2706621,
				-2686389,
				-2662227,
				-2634245,
				-2602564,
				-2567300,
				-2528577,
				-2486520,
				-2441257,
				-2392916,
				-2341630,
				-2287530,
				-2230753,
				-2171433,
				-2109710,
				-2045720,
				-1979604,
				-1911500,
				-1841549,
				-1769891,
				-1696667,
				-1622017,
				-1546081,
				-1468998,
				-1390907,
				-1311946,
				-1232252,
				-1151960,
				-1071205,
				-990118,
				-908833,
				-827476,
				-746176,
				-665056,
				-584242,
				-503850,
				-424001,
				-344808,
				-266384,
				-188837,
				-112275,
				-36799,
				37490,
				110497,
				182128,
				252294,
				320909,
				387893,
				453165,
				516652,
				578282,
				637991,
				695713,
				751393,
				804972,
				856403,
				905636,
				952632,
				997349,
				1039755,
				1079819,
				1117514,
				1152818,
				1185713,
				1216184,
				1244222,
				1269818,
				1292973,
				1313684,
				1331960,
				1347806,
				1361236,
				1372266,
				1380915,
				1387205,
				1391164,
				1392818,
				1392202,
				1389350,
				1384302,
				1377097,
				1367781,
				1356398,
				1343001,
				1327638,
				1310365,
				1291237,
				1270313,
				1247652,
				1223317,
				1197371,
				1169880,
				1140910,
				1110530,
				1078808,
				1045816,
				1011623,
				976305,
				939931,
				902578,
				864317,
				825224,
				785374,
				744842,
				703701,
				662027,
				619894,
				577377,
				534547,
				491481,
				448248,
				404921,
				361571,
				318267,
				275078,
				232072,
				189313,
				146869,
				104802,
				63174,
				22044,
				-18526,
				-58483,
				-97768,
				-136331,
				-174118,
				-211082,
				-247173,
				-282348,
				-316562,
				-349776,
				-381948,
				-413045,
				-443029,
				-471871,
				-499539,
				-526007,
				-551248,
				-575242,
				-597965,
				-619401,
				-639533,
				-658348,
				-675835,
				-691985,
				-706790,
				-720247,
				-732353,
				-743109,
				-752516,
				-760579,
				-767303,
				-772699,
				-776775,
				-779546,
				-781024,
				-781227,
				-780171,
				-777879,
				-774369,
				-769667,
				-763796,
				-756784,
				-748658,
				-739447,
				-729181,
				-717893,
				-705616,
				-692383,
				-678230,
				-663193,
				-647309,
				-630616,
				-613152,
				-594958,
				-576072,
				-556535,
				-536389,
				-515675,
				-494434,
				-472709,
				-450540,
				-427972,
				-405045,
				-381802,
				-358285,
				-334537,
				-310598,
				-286512,
				-262316,
				-238054,
				-213764,
				-189488,
				-165262,
				-141127,
				-117119,
				-93275,
				-69632,
				-46224,
				-23086,
				-251,
				22249,
				44381,
				66117,
				87426,
				108282,
				128656,
				148523,
				167859,
				186640,
				204845,
				222453,
				239443,
				255799,
				271502,
				286539,
				300894,
				314555,
				327509,
				339748,
				351261,
				362042,
				372082,
				381380,
				389930,
				397729,
				404778,
				411074,
				416621,
				421422,
				425477,
				428795,
				431379,
				433238,
				434379,
				434812,
				434547,
				433595,
				431968,
				429680,
				426743,
				423175,
				418988,
				414202,
				408831,
				402895,
				396410,
				389398,
				381877,
				373867,
				365389,
				356464,
				347113,
				337360,
				327224,
				316729,
				305898,
				294753,
				283318,
				271615,
				259667,
				247499,
				235132,
				222591,
				209897,
				197076,
				184148,
				171136,
				158064,
				144952,
				131823,
				118699,
				105600,
				92547,
				79561,
				66661,
				53866,
				41197,
				28670,
				16306,
				4118,
				-7873,
				-19654,
				-31207,
				-42520,
				-53575,
				-64362,
				-74866,
				-85075,
				-94978,
				-104564,
				-113821,
				-122743,
				-131319,
				-139541,
				-147401,
				-154895,
				-162014,
				-168756,
				-175113,
				-181084,
				-186665,
				-191854,
				-196647,
				-201046,
				-205049,
				-208658,
				-211872,
				-214693,
				-217123,
				-219166,
				-220823,
				-222101,
				-223002,
				-223533,
				-223697,
				-223502,
				-222954,
				-222060,
				-220827,
				-219264,
				-217376,
				-215177,
				-212671,
				-209870,
				-206782,
				-203419,
				-199790,
				-195904,
				-191774,
				-187410,
				-182822,
				-178023,
				-173023,
				-167834,
				-162467,
				-156935,
				-151247,
				-145418,
				-139457,
				-133378,
				-127191,
				-120909,
				-114541,
				-108102,
				-101600,
				-95049,
				-88459,
				-81840,
				-75206,
				-68563,
				-61925,
				-55302,
				-48702,
				-42136,
				-35613,
				-29144,
				-22736,
				-16399,
				-10139,
				-3968,
				2109,
				8083,
				13949,
				19698,
				25324,
				30821,
				36183,
				41404,
				46481,
				51406,
				56177,
				60788,
				65238,
				69520,
				73634,
				77574,
				81340,
				84930,
				88340,
				91572,
				94623,
				97490,
				100177,
				102681,
				105002,
				107140,
				109098,
				110876,
				112476,
				113897,
				115142,
				116214,
				117116,
				117848,
				118414,
				118816,
				119059,
				119145,
				119079,
				118862,
				118500,
				117995,
				117353,
				116578,
				115675,
				114646,
				113498,
				112234,
				110858,
				109381,
				107798,
				106120,
				104354,
				102500,
				100564,
				98552,
				96470,
				94321,
				92112,
				89844,
				87527,
				85162,
				82757,
				80314,
				77839,
				75335,
				72810,
				70265,
				67707,
				65138,
				62565,
				59989,
				57416,
				54848,
				52291,
				49748,
				47222,
				44717,
				42233,
				39783,
				37354,
				34962,
				32608,
				30290,
				28010,
				25774,
				23585,
				21443,
				19349,
				17303,
				15311,
				13372,
				11490,
				9663,
				7893,
				6180,
				4526,
				2932,
				1398,
				-76,
				-1488,
				-2840,
				-4130,
				-5361,
				-6529,
				-7639,
				-8686,
				-9675,
				-10606,
				-11468,
				-12293,
				-13043,
				-13738,
				-14385,
				-14978,
				-15516,
				-15998,
				-16430,
				-16814,
				-17152,
				-17443,
				-17688,
				-17888,
				-18045,
				-18161,
				-18238,
				-18277,
				-18280,
				-18248,
				-18183,
				-18085,
				-17958,
				-17800,
				-17616,
				-17406,
				-17173,
				-16916,
				-16641,
				-16346,
				-16012,
				-15729,
				-15343,
				-14976,
				-14613,
				-14243,
				-13854,
				-13451,
				-13037,
				-12621,
				-12204,
				-11786,
				-11368,
				-10948,
				-10526,
				-10103,
				-9680,
				-9257,
				-8837,
				-8421,
				-8011,
				-7608,
				-7213,
				-6825,
				-6446,
				-6075,
				-5713,
				-5360,
				-5015,
				-4679,
				-4353,
				-28169,
				0
				};
	}
	
}
